"""
@Author  : 康帅
@Time    : 2021/3/16 9:49
@Function: 克隆模式(原型模式)
"""
from copy import copy, deepcopy


class Person:
    """ 人 """

    def __init__(self, name, age):
        self.__name = name
        self.__age = age

    def show_my_self(self):
        print("我是：" + self.__name + ",年龄" + str(self.__age) + "。")

    def coding(self):
        print("我是程序员，我用程序改变世界")

    def reading(self):
        print("阅读使我快乐！")

    def fall_in_love(self):
        print("春风吹，月亮明")

    def clone(self):
        return copy(self)


if __name__ == '__main__':
    tony = Person("Tony", 27)
    tony.show_my_self()
    tony.coding()

    tony1 = tony.clone()
    tony1.show_my_self()
    tony1.reading()

    tony2 = tony.clone()
    tony2.show_my_self()
    tony2.fall_in_love()
